import Vue from 'vue'
import VueRouter from 'vue-router'
import login from '@v/login.vue'
import notFound from '@v/notFound.vue'
import index from '@v/index.vue'

Vue.use(VueRouter)

const routes = [
    // {
    //   path: '/login',
    //   name: 'login',
    //   component: login,
    //   meta: {
    //     alive: true
    //   }
    // },
    {
        path: '/',
        redirect: "/index/chartMain"
    },
    {
        path: '/notFound',
        name: 'notFound',
        component: () => import('../views/notFound.vue'), // 首页默认的统计页面
    },
    {
        path: '/index',
        name: 'index',
        component: index,
        redirect: "/index/chartMain",
        meta: {
            alive: true
        },

        children: [
            {
                path: 'login',
                name: 'login',
                component: resolve => require(['@v/login.vue'], resolve), // 首页默认的统计页面
            },
            {
                path: 'chartMain',
                name: 'chartMain',
                component: resolve => require(['@c/chartMain/chartStat.vue'], resolve), // 首页默认的统计页面
            },
            {
                path: 'regManagement',
                name: 'regManagement',
                component: resolve => require(['@c/regManagement/regManagement.vue'], resolve), // 报名管理
            },
            {
                path: 'classManagement',
                name: 'classManagement',
                component: resolve => require(['@c/classManagement/classManagement.vue'], resolve), // 课程管理
            },
            {
                path: 'postRelease',
                name: 'postRelease',
                component: resolve => require(['@c/postRelease/postRelease.vue'], resolve), // 发布岗位
            },
            {
                path: 'receivedResume',
                name: 'receivedResume',
                component: resolve => require(['@c/viewResume/receivedResume.vue'], resolve), // 收到的简历
            },
            {
                path: 'findResume',
                name: 'findResume',
                component: resolve => require(['@c/viewResume/findResume.vue'], resolve), // 寻找简历
            },

            //admin
            {
                path: 'orgManage',
                name: 'orgManage',
                component: resolve => require(['@c/admin/organization.vue'], resolve), // 组织机构管理
            },
            {
                path: 'menu',
                name: 'menu',
                component: resolve => require(['@c/admin/menu.vue'], resolve), // 菜单
            },
            {
                path: 'role',
                name: 'role',
                component: resolve => require(['@c/admin/role.vue'], resolve), // 角色
            },
            {
                path: 'roleMenu',
                name: 'roleMenu',
                component: resolve => require(['@c/admin/roleMenu.vue'], resolve), // 角色-菜单关联
            },
            {
                path: 'industry',
                name: 'industry',
                component: resolve => require(['@c/admin/industry.vue'], resolve), // 行业管理
            },
            {
                path: 'user',
                name: 'user',
                component: resolve => require(['@c/admin/user.vue'], resolve), // 用户管理
            },
            {
                path: 'userInfo',
                name: 'userInfo',
                component: resolve => require(['@c/userInfo/userInfo.vue'], resolve), // 信息详情
            },
            {
                path: 'pwdManage',
                name: 'pwdManage',
                component: resolve => require(['@c/pwdManage/pwdManage.vue'], resolve), // 密码维护
            },
            {
                path: 'trainClasses',
                name: 'trainClasses',
                component: resolve => require(['@c/trainClasses/trainClasses.vue'], resolve), // 培训班级
            },

        ]
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
